const express = require("express");
const router = express.Router();
const BannerController = require("../controllers/bannerController");
const { verifyToken } = require("../middleware/auth");

// 公开接口
router.get("/", BannerController.getAllBanners);
router.get("/:id", BannerController.getBannerById);

// 需要管理员权限的接口
router.post("/", verifyToken, BannerController.createBanner);
router.put("/:id", verifyToken, BannerController.updateBanner);
router.delete("/:id", verifyToken, BannerController.deleteBanner);

module.exports = router;
